function formatTime(milliseconds) {
  if (!milliseconds) {
    return '';
  }
  // 计算总秒数和剩余毫秒数
  let totalSeconds = Math.floor(milliseconds / 1000);

  // 计算小时、分钟、秒钟数
  let hours = Math.floor(totalSeconds / 3600);
  let minutes = Math.floor(totalSeconds % 3600 / 60);
  let seconds = totalSeconds % 60;

  // 将时间格式化为 HH:mm:ss.SSS 格式
  if (minutes < 10 && minutes !== 0) {
    minutes = '0' + minutes;
  }
  if (seconds < 10 && seconds !== 0) {
    seconds = '0' + seconds;
  }
  let format = hours + '时' + minutes + '分' + seconds + '秒';
  return format;
}
export default formatTime;
